package com.example.mall.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.mall.util.CodeGenerateUtils;

import java.io.Serializable;

/**
 * <p>
 * 库存锁定记录表
 * </p>
 *
 * @author whale
 * @since 2025-05-09
 */
@TableName("tb_inventory_locks")
public class InventoryLocks extends Model<InventoryLocks> {

    private static final long serialVersionUID = 1L;

    /**
     * 锁定记录唯一标识
     */
    @TableId("lock_id")
    private Long lockId;
    /**
     * 商品ID（关联商品表）
     */
    @TableField("product_id")
    private Long productId;
    /**
     * 规格ID（关联规格表，如果支持多规格）
     */
    @TableField("spec_id")
    private Long specId;
    /**
     * 订单ID（关联订单表）
     */
    @TableField("order_id")
    private Long orderId;
    /**
     * 锁定库存数量
     */
    @TableField("locked_stock")
    private Integer lockedStock;
    /**
     * 锁定状态（0：锁定，1：释放）
     */
    @TableField("lock_status")
    private Integer lockStatus;
    /**
     * 创建时间
     */
    @TableField("create_date")
    private Date createDate;
    /**
     * 更新时间
     */
    @TableField("update_date")
    private Date updateDate;

    public InventoryLocks() {
        this.lockId = Long.valueOf(CodeGenerateUtils.generateUniqueId());
    }

    public Long getLockId() {
        return lockId;
    }

    public void setLockId(Long lockId) {
        this.lockId = lockId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public Long getSpecId() {
        return specId;
    }

    public void setSpecId(Long specId) {
        this.specId = specId;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Integer getLockedStock() {
        return lockedStock;
    }

    public void setLockedStock(Integer lockedStock) {
        this.lockedStock = lockedStock;
    }

    public Integer getLockStatus() {
        return lockStatus;
    }

    public void setLockStatus(Integer lockStatus) {
        this.lockStatus = lockStatus;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }


    @Override
    public String toString() {
        return "InventoryLocks{" +
        ", lockId=" + lockId +
        ", productId=" + productId +
        ", specId=" + specId +
        ", orderId=" + orderId +
        ", lockedStock=" + lockedStock +
        ", lockStatus=" + lockStatus +
        ", createDate=" + createDate +
        ", updateDate=" + updateDate +
        "}";
    }
}
